package model;

import design.patterns.observer.Subject;

/**
 * Created by nuno-rafael-figueiredo on 17-03-2014.
 */
public class Item<Key> extends Subject implements IItem<Key> {
    private final Key key;

    public Item(Key key) {
        this.key = key;
    }

    public Key getKey() {
        return key;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;

        if (o == null || getClass() != o.getClass())
            return false;

        Item station = (Item) o;

        return getKey().equals(station.getKey());

    }

    @Override
    public int hashCode() {
        return getKey().hashCode();
    }
}
